
#ifndef GAMEENGINE_H
#define GAMEENGINE_H

#include <vector>
#include <SFML/Graphics.hpp>

using namespace std;

class CGameState;

class CEngine {
public:

	void Init(const char* title, int width=800, int height=600, int bpp=0, int framerate=0, bool fullscreen=false, bool debug=false);
	void Cleanup();

	void ChangeState(CGameState* state);
	void PushState(CGameState* state);
	void PopState();

	void HandleEvents();
	void Update();
	void Draw();

	bool Running() { return running; }
	void setCurFramerate(int framerate) { curFramerate = framerate; }
	void setCurFrequence(int frequency) { curFrequency = frequency; }
	void Quit() { running = false; }

	sf::RenderWindow window;

private:
	// the stack of states
	vector<CGameState*> states;

	sf::String *debugText;
	char *curState;
	int curFramerate;
	int curFrequency;
	bool running;
	bool fullscreen;
	bool debug;
};

#endif